﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Comissoes.Models.CondicoesPagamentoModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
    <!-- CSS -->
    <%= ViewData["scripts"] %>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icolst" />
        <span class="txt">
            <%= Html.Encode("Edição de Condições de Pagamento") %>
        </span>
    </div>    
    <form action="javascript:saveDialog('CondicoesPagamento', $('#COD_CDPG').val())">
        <fieldset class="container transparent">
            <label class="input160">
                <button class="diskcommand" type="submit"">Salvar</button>
                <% if (Model.condicao.COD_CDPG == 0)
                   { %>                    
                    <button class="closecommand" type="button" onclick="loadOption('/CondicoesPagamento/Index', true);">Cancelar</button>
                <% }
                   else
                   { %>
                    <button class="closecommand" type="button" onclick="loadOption('/CondicoesPagamento/Details/<%= Html.Encode(Model.condicao.COD_CDPG) %>', true);">Cancelar</button>
                <% } %>
            </label>
        </fieldset>
        <fieldset class="container field360 border ui-widget-content ui-corner-all">
            <% if (Model.condicao.COD_CDPG == 0)
               { %>
                    <%= Html.Hidden("COD_CDPG", Model.condicao.COD_CDPG)%>
            <% } %>
            <% else
                { %>
                    <%= Html.Label("COD_CDPG", "for80", "Código:") %>
                    <%= Html.LabelInput(Html.TextBox("COD_CDPG", Model.condicao.COD_CDPG, new { @readonly = "readonly" }), "input80 right") %>
            <% } %>

            <%= Html.Label("TIPO_CDPG", "for80 clear", "Tipo:")%>
            <%= Html.LabelInput(Html.DropDownList("TIPO_CDPG", Model.TIPO_CDPG), "select100 setfocus")%>

            <%= Html.Label("TAXA_CDPG", "for40 right", "Taxa:")%>
            <%= Html.LabelInput(Html.TextBox("TAXA_CDPG", Model.condicao.TAXA_CDPG, new { disabled = string.IsNullOrEmpty(Model.condicao.TIPO_CDPG) || Model.condicao.TIPO_CDPG == "B", title = "taxa de despesa agregada" }), "input100 decimal")%>

            <%= Html.Label("DESC_CDPG", "for80 clear", "Descrição:")%>
            <%= Html.LabelInput(Html.TextBox("DESC_CDPG", Model.condicao.DESC_CDPG, new { title = "descrição da condição de pagamento" }), "input260 calendar") %>
            
            <%= Html.Label("COEF_CDPG", "for80 clear", "Coeficiente:") %>
            <%= Html.LabelInput(Html.TextBox("COEF_CDPG", Model.condicao.COEF_CDPG, new { disabled = Model.condicao.TIPO_CDPG == "A", title = "tipo da condição de pagamento" }), "input100 decimal")%>
            
            <%= Html.Label("DIA_CDPG", "for40 right", "Dias:")%>
            <%= Html.LabelInput(Html.TextBox("DIA_CDPG", Model.condicao.DIA_CDPG, new { disabled = Model.condicao.TIPO_CDPG == "A", title = "intervalo de dias" }), "input100 decimal")%>
            
            <%= Html.Label("PARCELAS_CDPG", "for80 clear", "Parcelas:")%>
            <%= Html.LabelInput(Html.TextBox("PARCELAS_CDPG", Model.condicao.PARCELAS_CDPG, new { disabled = Model.condicao.TIPO_CDPG == "A", title = "número de parcelas" }), "input100 decimal")%>
            
            <%= Html.Label("TAC_CDPG", "for40 right", "TAC:")%>
            <%= Html.LabelInput(Html.TextBox("TAC_CDPG", Model.condicao.TAC_CDPG, new { disabled = Model.condicao.TIPO_CDPG == "A", title = "taxa de abertura de crédito" }), "input100 decimal")%>
        </fieldset>
    </form>
</body>
</html>